<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .rotate_box {
        display: flex;
      }
      /* 旋转动画 */
      @keyframes rotate_triangle {
        0% {
          transform: rotate(0deg);
        }
        50% {
          transform: rotate(80deg);
        }
        100% {
          transform: rotate(0deg);
        }
      }
      .rotate {
        animation: rotate_triangle 4s linear infinite;
      }
      .rotate2 {
        width: 24px;
        height: 16px;
        margin-left: 160px;
        margin-top: 50px;
        cursor: pointer;
      }
      .rotate2:hover {
        /* transition 过渡属性 应用场景，悬浮阴影，放大缩小等处增加过渡效果更自然 */
        transition: all 0.3s;
        transform: rotate(180deg);
      }
    </style>
  </head>
  <body>
    <!-- 
      主要单词：
      动画：animation
      变换：transform
      过渡：transition
      旋转：rotate

      关键css属性
      向元素应用2D或3D转换:transform
      设置动画属性（设置六个动画属性，包括动画名称、持续时间、时间函数、延迟、迭代次数和方向）：animation 
      过渡：transition
      旋转：rotate
    -->
    <div class="rotate_box">
      <!-- 旋转动画 -->
      <img class="rotate" src="./img/triangle.png" alt="" />
      <!-- 旋转动画2 -->
      <img class="rotate2" src="./img/catalog-down.png" alt="" />
    </div>
  </body>
</html>
